package br.ufmg.dcc.vod.remoteworkers.util;

import java.util.concurrent.SynchronousQueue;

public class SyncQueueBasedLock {

	private SynchronousQueue<Object> queue;

	public SyncQueueBasedLock() {
		this.queue = new SynchronousQueue<Object>();
	}
	
	public void lock() throws InterruptedException {
		queue.put(new Object());
	}
	
	public void unlock() throws InterruptedException {
		queue.take();
	}
}
